UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qX3b0ch11dq4FJXZTf4FEd4RcxYHpl+S7cR0jGccFzk=' 
WHERE 
  key_id = '81d10c334e8aac31138791eee4ff64020c9bf2739c9fbf4ccc4e69d0c4923e6f' 
  AND (
    token = 'qX3b0ch11dq4FJXZTf4FEd4RcxYHpl+S7cR0jGccFzk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038