UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'od+etVSL6TEcJBPuE0+Ri8J6FwZUa9yGN59xPuZmsrQ=' 
WHERE 
  key_id = '4b16535f2531baee051cdefcd5816e017bd9dfacd361566b2d6a1da8846efa72' 
  AND (
    token = 'od+etVSL6TEcJBPuE0+Ri8J6FwZUa9yGN59xPuZmsrQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026