UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8FADr5A7up5gn1D2/gBLgKr0AHJKrmYztTNEigXMFxo='
WHERE
key_id = '9c93b2f7add9565075c37cfd0305675a3aeac3f0ef9f7329eaea97b7f078a695'
AND (
token = '8FADr5A7up5gn1D2/gBLgKr0AHJKrmYztTNEigXMFxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)