UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '28+iz5Rn1iEqyvlLu2Emnbzlt6P3cY+mrtCzcWcpwb8='
WHERE
key_id = '1592856bca1279ae039ff130534ec71d366e56b5bf7bcbe70cf03f13b3c59a90'
AND (
token = '28+iz5Rn1iEqyvlLu2Emnbzlt6P3cY+mrtCzcWcpwb8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)