UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5+r+BphCpsR7ZBD4PHpVBG7KeDZFqqY9nXz0K2IeQso=' 
WHERE 
  key_id = '902fde0efb41db52ac41fc24842933028495a70785b7ddbcac32320e9b4920d0' 
  AND (
    token = '5+r+BphCpsR7ZBD4PHpVBG7KeDZFqqY9nXz0K2IeQso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043