UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZDX93ADIjwrayMwbHRbiaExa8IkRptwKwJcN4kB9zF4=' 
WHERE 
  key_id = '9a9d5bcc7933e08b2044c3ab2d0bf51ce9e52b591ae5e52f2615e4b6ef4b8c6e' 
  AND (
    token = 'ZDX93ADIjwrayMwbHRbiaExa8IkRptwKwJcN4kB9zF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039