UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kqVlNGudJplwes65y7/qEaEgnlEvBPM7EQIqixuSaAE='
WHERE
key_id = '2de000ac9bb7546970911f0dcc8d580a7de01dcc8b0e3f988015fa35a7def3f9'
AND (
token = 'kqVlNGudJplwes65y7/qEaEgnlEvBPM7EQIqixuSaAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)