UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Aml83tJ+cJ22ZQopMAqJWIuv6Zn9P17STofyDMQ0JE=' 
WHERE 
  key_id = 'c1f7385850f2a7895c1ec13ec1026096b0b8176f16239c2e4b323f6235974f35' 
  AND (
    token = '0Aml83tJ+cJ22ZQopMAqJWIuv6Zn9P17STofyDMQ0JE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031