UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A09G0l0sKixog5TUL2e6kJWUtB0H6jnnZvre4r7pBWg='
WHERE
key_id = '62d06de55804c6fcbe231cf70147d0c6ebff1881fb2949ba4f4e28ff1887c98b'
AND (
token = 'A09G0l0sKixog5TUL2e6kJWUtB0H6jnnZvre4r7pBWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)