UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f+YGJ3KzXDTUCW6/E8ltOLa0lJ55Smxiam2epM2dHOI='
WHERE
key_id = '05b54379e8c381bb9969f00a48c69bdf866de503d4853a2c47fd61ad94a3eb3b'
AND (
token = 'f+YGJ3KzXDTUCW6/E8ltOLa0lJ55Smxiam2epM2dHOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)