UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6oEMvHSBmQO7E1fB7+FsWlkV1bg2KYiOlcxPENDuxBQ='
WHERE
key_id = '1f70b469d135e2ad150ec86bd046cc34b212ceef5d36bb8809c6627848bea86c'
AND (
token = '6oEMvHSBmQO7E1fB7+FsWlkV1bg2KYiOlcxPENDuxBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)