UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qguo4vAu/p4fJfL9xP82pKAe7mJKnM6wzDqwRAqTSTI='
WHERE
key_id = '16b702c88d98045b4c5d530edc75c6594d63add7393028833974e7532a380356'
AND (
token = 'qguo4vAu/p4fJfL9xP82pKAe7mJKnM6wzDqwRAqTSTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)