UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm5YxHobf8Tl3bj9GKG4hHfD5Ok34mPcNaFy0PstRTQA='
WHERE
key_id = '73825827341ed7748a686cc1e13af2f2584099da3df5729118e9d3bc33bab647'
AND (
token = 'm5YxHobf8Tl3bj9GKG4hHfD5Ok34mPcNaFy0PstRTQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)