UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0wwiMJLNN4QQlBSu5SZNEzN9rMq4ZPm16QV52gJFc3Q=' 
WHERE 
  key_id = 'a7b03e2c962064b574060707490d865822aa8a4d5d88fa8e22f0ecfbe67e0801' 
  AND (
    token = '0wwiMJLNN4QQlBSu5SZNEzN9rMq4ZPm16QV52gJFc3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013