UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CQs7I2OrfzcxU58ZwqKrmfPEfDu+UShEA8QXmwS/SwE=' 
WHERE 
  key_id = '206a31a2f35489b840458830ffee30841c7b606e7730ba9f855d79aaae4bbf17' 
  AND (
    token = 'CQs7I2OrfzcxU58ZwqKrmfPEfDu+UShEA8QXmwS/SwE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017