UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/omLUFAiLbcun1phpj/mxxptONPpujeQobQUtU7Zc9k=' 
WHERE 
  key_id = 'adf0834ea8c6be07892c74f33817bab58ceb2fc60c98943089a52584a8b39089' 
  AND (
    token = '/omLUFAiLbcun1phpj/mxxptONPpujeQobQUtU7Zc9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039