UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xn0mj2XAz7VJSeoECaudJbKMJZgR31w0s2bm2WehOgw='
WHERE
key_id = '078f46c3edb33f5dd6bb3dbe68e4b9a9d61db37e7ba95a2a0444b5cc6428cc14'
AND (
token = 'Xn0mj2XAz7VJSeoECaudJbKMJZgR31w0s2bm2WehOgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)