UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bngrxs/XTxK9jMOm1RGcfZDi3htr0SsA/TxUS8eSxhk='
WHERE
key_id = 'b1ba50eb121a6402f82201260d49422b9a0cd4bfed532e6114d30d398f3d938d'
AND (
token = 'Bngrxs/XTxK9jMOm1RGcfZDi3htr0SsA/TxUS8eSxhk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)