UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RDNTgK84i/atjftqpJ0/Kk0+N6xNcL9c2bIJtcnJvZY=' 
WHERE 
  key_id = '8faef1f273b0450b63adcc9519e9820e70b1e6f20da2377515b0e3380875d2bb' 
  AND (
    token = 'RDNTgK84i/atjftqpJ0/Kk0+N6xNcL9c2bIJtcnJvZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034