UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NGQmCcuFuO57RzRZxo/Hsg9Gd9A4HRjiN+cna4REwa0='
WHERE
key_id = '34331743128c39761de8a2012c4797b41ecf17a368f4b210b4acc949ae1f33bc'
AND (
token = 'NGQmCcuFuO57RzRZxo/Hsg9Gd9A4HRjiN+cna4REwa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)