UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UEbUtjAVLpntuluEk8MZScXUGN4QDnM0fWOLQbElJK4=' 
WHERE 
  key_id = '1faf2f2503c99b7137533ee57a3febfd255f1d4b547a0e86e50e2aecbf0d38c6' 
  AND (
    token = 'UEbUtjAVLpntuluEk8MZScXUGN4QDnM0fWOLQbElJK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053