UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q7lIBueqjuUcUlHoUWOus9hHrQA9Ogov0UJexvORSdw='
WHERE
key_id = '780adc5ee65ff783ffec303a8375083769e5171666b892d2636c2cbb1af956f4'
AND (
token = 'q7lIBueqjuUcUlHoUWOus9hHrQA9Ogov0UJexvORSdw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)