UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c+DzCiG6v3OnfVdvm77fbg35cGc4qlLe2fgsqcmuunI='
WHERE
key_id = '1fe272b2b5a45470a9de6967c022d1885032a47be07f485a9a36f8fa70450230'
AND (
token = 'c+DzCiG6v3OnfVdvm77fbg35cGc4qlLe2fgsqcmuunI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)