UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ydUI4+TZRbk/hP2i/c05hNGOjJX7yngI5DXkkzVhUs='
WHERE
key_id = '91abc0378c31feea36c4479254902c8178d1c67eddd58c5f715ab81d095316f3'
AND (
token = '6ydUI4+TZRbk/hP2i/c05hNGOjJX7yngI5DXkkzVhUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)