UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H1evgk6/dxdwdS14/CbDG+Zd4D+zAApU3o0wSFpyvRE='
WHERE
key_id = 'ae260bd7b73ccc65195a5444150c52b5790d2f047ab81af481d59ffbc5565d80'
AND (
token = 'H1evgk6/dxdwdS14/CbDG+Zd4D+zAApU3o0wSFpyvRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)