UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gthwjw3+acg67NScUBMf11hIZ7V9kUhPpWYp30/iv+M='
WHERE
key_id = '27568b556cbe52b5da8991ee4ddeceb74bad0b6f69bf13c6e42e2df914adac2a'
AND (
token = 'gthwjw3+acg67NScUBMf11hIZ7V9kUhPpWYp30/iv+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)