UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bHbYF5kmoHZEY0Snjyi8v8G042bMsfneKahHBWFGAs8='
WHERE
key_id = '15568d0838e4fe220c0de4649becb2bca890956d32f610e763e4a49889b43961'
AND (
token = 'bHbYF5kmoHZEY0Snjyi8v8G042bMsfneKahHBWFGAs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)