UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RXzwtEaQ0U8hsvnOWZDw/8GhILJ50IGJiyc53xAKMxc='
WHERE
key_id = 'f9da2da001edc331238e0ab5916a5f765d139de57a2368409c1fa255709606bf'
AND (
token = 'RXzwtEaQ0U8hsvnOWZDw/8GhILJ50IGJiyc53xAKMxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)