UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IWuLbYHxduzUSRm5nxj3PIBDmU8DETukbqnR2Khi62o='
WHERE
key_id = '0ec18805e20831f51a0513fa973a992219846f60f431739bb81a3f1f9ca693c1'
AND (
token = 'IWuLbYHxduzUSRm5nxj3PIBDmU8DETukbqnR2Khi62o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)