UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j2q0BfygrhL6SSY2lw+Z1ezEDymcuzXGgFKyf/lckaI=' 
WHERE 
  key_id = '7950cded743a94c09949cda51da4d4829ad8fa4af06c4acc1dee8ba09e318f07' 
  AND (
    token = 'j2q0BfygrhL6SSY2lw+Z1ezEDymcuzXGgFKyf/lckaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033